﻿#region Using Directives

    using System;
    using System.Collections.Generic;

    using Csla;

#endregion

namespace MarketPulse.BusinessLogic.Core.Criteria
{
    /// <summary>
    /// Criteria class that allows a profile to be uniquely identified by the username and profile type
    /// </summary>
    [Serializable]
    public class UsernameAndProfileTypeGUIDCriteria : CriteriaBase<UsernameAndProfileTypeGUIDCriteria>
    {

        #region Constructors

            /// <summary>
            /// Default constructor for this class
            /// </summary>
            /// <param name="username">The username of the user to asscoiate with this criteria</param>  
            /// <param name="profileTypeGuid">The GUID of the type of the profile to asscoiate with this criteria</param> 
        public UsernameAndProfileTypeGUIDCriteria(string username, Guid profileTypeGUID)
            {
                Username = username;
                ProfileTypeGUID = profileTypeGUID;
            }

        #endregion

        #region Properties

            /// <summary>
            /// This is the unique username used to identify the user being selected as part of this criteria
            /// </summary>
            public static PropertyInfo<string> UsernameProperty = RegisterProperty<string>(p => p.Username);
            /// <summary>
            /// This is the unique username used to identify the user being selected as part of this criteria
            /// </summary>
            public string Username
            {
                get { return ReadProperty(UsernameProperty); }
                private set { LoadProperty(UsernameProperty, value); }
            }

            /// <summary>
            /// The GUID of the profile type of the profile.
            /// </summary>
            public static PropertyInfo<Guid> ProfileTypeGUIDProperty = RegisterProperty<Guid>(p => p.ProfileTypeGUID);
            /// <summary>
            /// The GUID of the profile type of the profile.
            /// </summary>
            public Guid ProfileTypeGUID
            {
                get { return ReadProperty(ProfileTypeGUIDProperty); }
                set { LoadProperty(ProfileTypeGUIDProperty, value); }
            }

        #endregion

    }
}
